﻿using System.Collections.Generic;

namespace Hx.Infrastructure.Common
{
    public class PagedResult<TModel>
    {
        /// <summary>
        ///     Initializes a new instance of the <see cref="PagedResult{T}" /> class.
        /// </summary>
        /// <param name="recordCount">The record count.</param>
        /// <param name="pageCount">The page count.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="pageIndex">Index of the page.</param>
        /// <param name="dataSource">The data source.</param>
        public PagedResult(int recordCount, int pageCount, int pageSize, int pageIndex, List<TModel> dataSource)
        {
            PageCount = pageCount;
            RecordCount = recordCount;
            PageSize = pageSize;
            PageIndex = pageIndex;
            DataSource = dataSource;
        }

        #region Properties

        /// <summary>
        ///     记录个数
        /// </summary>
        public int RecordCount { get; set; }

        /// <summary>
        ///     总页数
        /// </summary>
        public int PageCount { get; set; }

        /// <summary>
        ///     页大小
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        ///     页索引
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        ///     数据源
        /// </summary>
        public List<TModel> DataSource { get; set; }

        #endregion
    }
}